#!/bin/bash
##############################################################
# File Name: run_client.sh
# Version: V1.0
# Author: zc
dir_path="$(cd $(dirname $0);cd ..; pwd)"
python_file="$dir_path/im_main/im_test.py"
echo $python_file
cd "/root/IMTest/im_main/"
nohup /usr/bin/python3 $python_file &
process=$1
pid=$(ps -ef | grep $python_file | grep -v grep  | awk '{print $2}')
echo $pid
i=1
while [ $i -le 5 ]
do
pid=$(ps -ef | grep $python_file | grep -v grep  | awk '{print $2}')
if [[ $pid  != "" ]]; then
	echo "runging^"
else
i=6
fi
done 
echo 'wait $!'
echo "ok"
